I am grappling a bit with the code sent by Doug Zawacki. If I replace the "TestToReq" and "ProgramUnitsToReq" with the appropriate names of the modules, I don't get the names of the tests (found in objProgramUnit."Object Heading"). I have tried the module name and even included the path to the module (I am opening and subsequently closing the correct modules). However, if I use "*", I do get the names of the test for the modules I want plus all the other in-links. pragma runLim, 0 Module mTest = current Module mReq = read("Req",false) Module mProgramUnits = read("ProgramUnits",false) Object objTest,objReq,objProgramUnit Link lnkTestReq, lnkPuReq Stream stmReport = write("C:\\temp\\MyReport.txt") // Loop through all links TEST->Req for objTest in mTest do { stmReport << "Test: " objTest."Object Heading" "\n" for lnkTestReq in objTest->"TestToReq" do { objReq = target(lnkTestReq) if (null objReq) continue if (isDeleted(objReq)) continue for lnkPuReq in objReq<-"ProgramUnitsToReq" do { objProgramUnit= source(lnkPuReq ) if (null objProgramUnit) continue if (isDeleted(objProgramUnit)) continue stmReport << "Covers: " identifier(objProgramUnit) " -- " objProgramUnit."Object Heading" "\n" } } } close(stmReport) close(mReq) close(mProgramUnits) ack "Done" SystemAdmin - Fri Mar 06 08:02:17 EST 2009 |
Re: Links traceability - linksets? 1. The module name in the loop is the link module name, not the target or source module name. 2. Module names are case sensitive. 3. Full paths must begin with a forward slash and be from the nearest project ancestor. 4. The source module must be open for in-links to show up, otherwise you have to use LinkRef's and then open the module. If none of these are the cause then you need to add some debug to find out where the problem is, for example put a count at the beginning of the link loop to count the links. |
Re: Links traceability - linksets? The crude version of what I do with links is this; notice it uses "*" in all the link loops, then checks the base unqualified name of the link module, ignoring links it doesn't care about. // <1> Make sure the source modules I care about is loaded. ModName_ mnSource, mnLink LinkRef lref for lref in obj <- "*" do { mnLink = module(lref) if (name(mnLink) != "MyLinkMod") continue // Don't care about this link read(fullName(source(lref)) } // end insuring the source module is open // <2> Now deal with the links for lnk in obj <- "*" { mnLink = module(lnk) if (name(mnLink) != "MyLinkMod") continue // Not a link I care about // Deal with this link } |